package com.basic;

import com.frame.struts.BaseBean;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.utils.CommUtil;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;


/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class ManageAbilityForm extends BaseBean {
    public ManageAbilityForm() {
    }


	ManageAbilityEntity ma = new ManageAbilityEntity();

		public String addManageAbility() {
			HttpServletRequest request = ActionContext.getActionContext().
				getRequest();
			HttpServletResponse response = ActionContext.getActionContext().
				getResponse();
			BasicFactory factory = new BasicFactory();
			String qyid = (String) request.getSession().getAttribute("session_qyid");
			ma.setQyid(qyid);
			ma.setOptdate(new Date());
			ma.setOptrid(CommUtil.getUserId(request));
			try{
			if(factory.addManageAbility(ma)){
				//System.out.println("wo zhi xing le!");
					response.sendRedirect("/basic/queryManageAbility.jsp?qyid="+qyid);
					return "success";
			}
			response.sendRedirect("/basic/failed.jsp");
			}
			catch (Exception e) {

			}

			return "failed";

		}

		public String modifyManageAbility(){
				HttpServletRequest request = ActionContext.getActionContext().
					getRequest();
				HttpServletResponse response = ActionContext.getActionContext().
					getResponse();
				BasicFactory factory = new BasicFactory();
				String qyid = (String) request.getSession().getAttribute("session_qyid");
				ma.setQyid(qyid);
				ma.setOptdate(new Date());
				ma.setOptrid(CommUtil.getUserId(request));
				factory.deleteManageAbility(ma.getQyid(),ma.getKfzz());
				try{
				if(factory.addManageAbility(ma)){
					//System.out.println("wo zhi xing le!");
						response.sendRedirect("/basic/queryManageAbility.jsp?qyid="+qyid);
						return "success";
				}
				response.sendRedirect("/basic/failed.jsp");
				}
				catch (Exception e) {

				}

				return "failed";
			}


			/**
			 * @return Returns the jk.
			 */
			public String getJk() {
				return ma.getJk();
			}
			/**
			 * @param jk The jk to set.
			 */
			public void setJk(String jk) {
				 ma.setJk(jk);
			}
			/**
			 * @return ma. return ma.s the jl.
			 */
			public String getJl() {
				return ma.getJl();
			}
			/**
			 * @param jl The jl to set.
			 */
			public void setJl(String jl) {
				 ma.setJl(jl);
			}
			/**
			 * @return ma. return ma.s the js.
			 */
			public String getJs() {
				return ma.getJs();
			}
			/**
			 * @param js The js to set.
			 */
			public void setJs(String js) {
				 ma.setJs(js);
			}
			/**
			 * @return ma. return ma.s the jz.
			 */
			public String getJz() {
				return ma.getJz();
			}
			/**
			 * @param jz The jz to set.
			 */
			public void setJz(String jz) {
				 ma.setJz(jz);
			}
			/**
			 * @return ma. return ma.s the kfzz.
			 */
			public String getKfzz() {
				return ma.getKfzz();
			}
			/**
			 * @param kfzz The kfzz to set.
			 */
			public void setKfzz(String kfzz) {
				 ma.setKfzz(kfzz);
			}
			/**
			 * @return ma. return ma.s the kj.
			 */
			public String getKj() {
				return ma.getKj();
			}
			/**
			 * @param kj The kj to set.
			 */
			public void setKj(String kj) {
				 ma.setKj(kj);
			}
			/**
			 * @return ma. return ma.s the optdate.
			 */
			public Date getOptdate() {
				return ma.getOptdate();
			}
			/**
			 * @param optdate The optdate to set.
			 */
			public void setOptdate(Date optdate) {
				 ma.setOptdate(optdate);
			}
			/**
			 * @return ma. return ma.s the optrid.
			 */
			public String getOptrid() {
				return ma.getOptrid();
			}
			/**
			 * @param optrid The optrid to set.
			 */
			public void setOptrid(String optrid) {
				 ma.setOptrid(optrid);
			}
			/**
			 * @return ma. return ma.s the qt.
			 */
			public String getQt() {
				return ma.getQt();
			}
			/**
			 * @param qt The qt to set.
			 */
			public void setQt(String qt) {
				 ma.setQt(qt);
			}
			/**
			 * @return ma. return ma.s the qyid.
			 */
			public String getQyid() {
				return ma.getQyid();
			}
			/**
			 * @param qyid The qyid to set.
			 */
			public void setQyid(String qyid) {
				 ma.setQyid(qyid);
			}
			/**
			 * @return ma. return ma.s the recstate.
			 */
			public String getRecstate() {
				return ma.getRecstate();
			}
			/**
			 * @param recstate The recstate to set.
			 */
			public void setRecstate(String recstate) {
				 ma.setRecstate(recstate);
			}
			/**
			 * @return ma. return ma.s the remark.
			 */
			public String getRemark() {
				return ma.getRemark();
			}
			/**
			 * @param remark The remark to set.
			 */
			public void setRemark(String remark) {
				 ma.setRemark(remark);
			}
			/**
			 * @return ma. return ma.s the shj.
			 */
			public String getShj() {
				return ma.getShj();
			}
			/**
			 * @param shj The shj to set.
			 */
			public void setShj(String shj) {
				 ma.setShj(shj);
			}
			/**
			 * @return ma. return ma.s the sj.
			 */
			public String getSj() {
				return ma.getSj();
			}
			/**
			 * @param sj The sj to set.
			 */
			public void setSj(String sj) {
				 ma.setSj(sj);
			}
			/**
			 * @return ma. return ma.s the ys.
			 */
			public String getYs() {
				return ma.getYs();
			}
			/**
			 * @param ys The ys to set.
			 */
			public void setYs(String ys) {
				 ma.setYs(ys);
			}
			/**
			 * @return ma. return ma.s the zy.
			 */
			public String getZy() {
				return ma.getZy();
			}
			/**
			 * @param zy The zy to set.
			 */
			public void setZy(String zy) {
				 ma.setZy(zy);
			}

}